home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / oper_sys / emerald / emrldsys.lha / Language / Compiler / Builtins / phoney_InStream.m < prev    next >
Text File  |  1990-08-16  |  1KB  |  40 lines

  1. % @(#)phoney_InStream.X    1.2  6/17/87
  2. %
  3. export _InStreamObject to "Builtins"
  4.  
  5. const _InStreamObject == immutable object _InStreamObject
  6.   export getSignature, create
  7.   const InStreamType == type InStreamType
  8.     operation getChar -> [Character]
  9.     operation unGetChar [ Character ]
  10.     operation getString -> [ String ]
  11.     function eos -> [Boolean]
  12.     operation close
  13.   end InStreamType
  14.   function getSignature -> [ r : Signature ]
  15.     r <- InStreamType
  16.   end getSignature
  17.   operation create [ fd : Integer ] -> [r : InStreamType]
  18.     r <- object aStream
  19.       export getChar, unGetChar, getString, eos, close
  20.       const myFD : Integer == fd
  21.       monitor
  22.     operation getChar -> [r : Character]
  23.       r <- 'a'
  24.     end getChar
  25.     operation unGetChar [r : Character]
  26.     end unGetChar
  27.     operation getString -> [r : String]
  28.       r <- "this is a line\^J"
  29.     end getString
  30.     function eos -> [r : Boolean]
  31.       r <- true
  32.     end eos
  33.     operation close
  34.     end close
  35.       end monitor
  36.     end aStream
  37.   end create
  38. end _InStreamObject
  39.